Socket
Socket
Sign inDemoInstall

@dumlj/seed-webpack-plugin

Package Overview
Dependencies
310
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @dumlj/seed-webpack-plugin

Basic webpack plugins


Version published
Maintainers
3
Created

Readme

Source

License: MIT  Github Repo  NPM Version  See Docs  codecov 

Seed Webpack Plugin

Basic webpack plugins

BACKGROUND

There is a lot of duplication in the development of Webpack plugins, so all '@dumlj/*-webpack-plugin's can inherit this basic plugin to make development more convenient.

FEATURE

  • Check for updates uniformly. Update prompts will only come from one checker, and only dependencies declared in package.json will be prompted (in nested plug-ins, undeclared dependencies will be ignored).
  • Provide some more general methods.

INSTALL

# use npm
$ npm install --dev @dumlj/seed-webpack-plugin
# use yarn
$ yarn add --dev @dumlj/seed-webpack-plugin
# use pnpm
$ pnpm add @dumlj/seed-webpack-plugin -D

USAGE

import { SeedWebpackPlugin, type SeedWebpackPluginOptions } from '@dumlj/seed-webpack-plugin'
import type { Compiler } from 'webpack'

export interface CustomWebpackPluginOptions extends SeedWebpackPluginOptions {
  unnecessary: string
}

export class CustomWebpackPlugin extends SeedWebpackPlugin {
  static PLUGIN_NAME = 'custom-webpack-plugin'
  protected unnecessary: string

  constructor(options?: CustomWebpackPluginOptions) {
    super(options)

    const { unnecessary } = options || {}
    this.unnecessary = unnecessary
  }

  public apply(compiler: Compiler) {
    super.apply(compiler)

    if (this.isSkipIncomplete('skip operation when necessary options are missed.', { unnecessary: this.unnecessary })) {
      return
    }

    compiler.hooks.thisCompilation.tap(this.pluginName, () => {
      this.logger.info('todo something...')
    })
  }
}

LIVE DEMO

INTERNAL DEPENDENCIES

@dumlj/seed-webpack-plugin
├─┬ @dumlj/feature-updater
│ ├─── @dumlj/shell-lib
│ ├─── @dumlj/util-lib
│ └─── @dumlj/mock-libPRIVATE
└── @dumlj/mock-libPRIVATE

FAQs

Last updated on 11 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc